#include<bits/stdc++.h>
using namespace std;
inline int read(){
    int w=1,s=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')w*=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        s=(s<<1)+(s<<3)+ch-'0';
        ch=getchar();
    }
    return w*s;
}
const int M=1e5+10;
struct Monst{
int r;
bool flag;
}a[M];
bool cmp(Monst x,Monst y){
return x.r<y.r;
}
struct sx{
int r,s;
}b[M];
int k;
int n;
int s,len=1;
int f[M];
map<int,int>ma;
map<int,int>::iterator it;
int maxn=INT_MIN;
bool cmp1(sx x,sx y){
return x.r>y.r;
}
int main(){

freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);

n=read();
for(int i=1;i<=n;i++){
    a[i].r=read();
    ma[a[i].r]++;
}
for(it=ma.begin();it!=ma.end();it++){
        b[++k].r=it->first;
        b[k].s=it->second;
    //cout<<it->first<<" "<<it->second<<endl;
}
sort(b+1,b+1+k,cmp1);
int eee=b[1].s;
//cout<<eee<<endl;
//cout<<eee<<endl;
for(int i=k-1;i>=1;i--){
    if(b[i].s>=b[i+1].s){
        b[i+1].s=0;
    }
    else{
        b[i].s+=abs(b[i].s-b[i+1].s);
    b[i+1].s=0;
    }

    //b[i].s-b[i+1].s;
    //cout<<b[i].r<<" "<<b[i].s<<endl;
}
int qw=0;
for(int i=1;i<=k;i++){
    qw+=b[i].s;
    //cout<<b[i].s<<endl;
}
cout<<qw;
/*
sort(a+1,a+1+n,cmp);
for(int i=1;i<=n;i++){
    cout<<a[i].r<<" ";
}
*/
/*
f[len]=a[1];
for(int i=2;i<=n;i++){
    if(f[len]<a[i]){
            f[++len]=a[i];
    }else{
        int l=1,r=len,mid;
        while(l<r){
            mid=l+r>>1;
            if(f[mid]>a[i]){
                r=mid;
            }
            else{
                l=mid+1;
            }
        }
        f[l]=a[i];
    }
}
cout<<n-len;*/
return 0;
}
/*
5
1 2 3 1 2

2

3 1
2 2
1 2

10
136 136 136 2417 136 136 2417 136 136 136
*/
